<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    
	<title>图书管理</title>
	<link rel="stylesheet" type="text/css" href="../styles/easyui.css">
	<link rel="stylesheet" type="text/css" href="../styles/icon.css">
	<link rel="stylesheet" type="text/css" href="../styles/demo.css">
	<script type="text/javascript" src="../jquery/jquery.min.js"></script>
	<script type="text/javascript" src="../jquery/jquery.easyui.min.js"></script>
    
</head>
<body background="http://img95.699pic.com/photo/00022/6875.jpg_wh300.jpg!/format/webp">

    <div class="header_right header_right_top">
      
        <font color="blue">${user.name }</font> <strong><a href="../user/logout.action" align="right">注销</a></strong></p>
       </div>

     <h2 align="center">图书管理</h2><br>
	<div align="center">
		 ISBN &nbsp:&nbsp<input type="text" name="isbn" id="isbn"/>
		 书名 &nbsp:&nbsp<input type="text" name="bookName" id="bookName"/>
		 作者 &nbsp:&nbsp<input type="text" name="author" id="author"/>
		 标签 &nbsp:&nbsp<input type="text" name="tag" id="tag"/>
	</div><br>
	     <div style="position: relative;">
	     <input type="button" name="submit" id="submit" value="查询" style="position: absolute; bottom: -22px; right: 270px;"/>
	     </div>
	<br><br><br>
	
	<h2>书籍列表</h2>
	<div style="margin:20px 0"></div>
	<table id="dg" title="书籍列表" style="width:1320px;height:360px"
			data-options="rownumbers:true,singleSelect:true,pagination:true,url:'../books/queryrtjson_eu.action',method:'post'">
		<thead>
			<tr>
				<th data-options="field:'isbn',width:130,align:'center'">ISBN</th>
				<th data-options="field:'language',width:40,align:'center'">语言</th>
				<th data-options="field:'bookName',width:140,align:'center'">书名</th>
				<th data-options="field:'author',width:180,align:'center'">作者</th>
				<th data-options="field:'publish',width:120,align:'center'">出版社</th>
				<th data-options="field:'tag',width:120,align:'center'">标签</th>
				<th data-options="field:'inTime',width:80,align:'center'">入库时间</th>
				<th data-options="field:'lendTime',width:80,align:'center'">借出时间</th>
				<th data-options="field:'deadline',width:80,align:'center'">归还期限</th>
				<th data-options="field:'borrower',width:120,align:'center'">借书者</th>
				<th data-options="field:'status',width:40,align:'center'">状态</th>
				<th data-options="field:'callno',width:90,align:'center'">索书号</th>
				<th data-options="field:'type',width:80,align:'center'">类别</th>
				<th data-options="field:'summary',width:80,align:'center'">简介</th>	
				<th data-options="field:'id'" hidden="true">id</th>		
			</tr>
		</thead>
	</table>
	
	<script type="text/javascript">
		$(function(){
			var pager = $('#dg').datagrid().datagrid('getPager');	// get the pager of datagrid
			pager.pagination({
				buttons:[{
					iconCls:'icon-search',
					handler:function(){
						location.href="/jsxt/user/toquery.action" 
						/* alert('search'); */
					}
				},{
					iconCls:'icon-add',
					handler:function(){
						 
						self.location.href="toinsert.action" 
					}
				},{
					iconCls:'icon-edit',
					handler:function(){
						var row =$('#dg').datagrid('getSelected');
						if (row){
							self.location.href="toedit.action?id="+row.id;
						}
					}
				},{
					iconCls:'icon-cancel',
					handler:function(){
						var row =$('#dg').datagrid('getSelected');
						if (row){
							location.href="/jsxt/books/delete.action?bookid="+row.id+"&adminid=${user.id}";
						}
					}
				}]
			});				
		})
	 	 $("#submit").click(function(){ 
	 		$('#dg').datagrid('load',{
	 			"booksModel.isbn": $("#isbn").val(), 
				"booksModel.bookName": $("#bookName").val(), 
				"booksModel.author": $("#author").val(), 
				"booksModel.tag": $("#tag").val()
	 		});
	 		
		}); 
	</script>	
</body>
</html>